export const getKnowledgeType = (item: any) => {
  const isAdd = item.some(
    (item: any) =>
      item?.reviewStatus === 'upload_pass' ||
      item?.reviewStatus === 'upload_reject' ||
      item?.reviewStatus === 'upload_publish' ||
      item?.reviewStatus === 'upload_reject_delete' ||
      item?.reviewStatus === 'upload_reject_review',
  ); //true:新增  false:删除
  if (isAdd) {
    return '上传';
  } else {
    return '删除';
  }
};
export const getKnowledgeStatus = (arr: any) => {
  if (!Array.isArray(arr) || arr.length === 0) return '';
  // 只取第一个元素的reviewStatus，或可根据实际需求调整
  const status = arr[0]?.reviewStatus;
  switch (status) {
    case 'upload_reject_delete':
      return '文件已删除';
    case 'delete_reject_ignore':
      return '已忽略';
    case 'upload_reject_review':
    case 'delete_reject_review':
      return '已重新审批';
    default:
      return '';
  }
};